<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/jspcommon.jsp"%> 
<script type="text/javascript">
	
	$(document).ready(function(){
		//计算出标签的个数，-1是因为有个添加标签的超链接
		var tagSize = $("#tag_count").find("a").size()-1;
		//十个样式的数组
		var styleArr = new Array(10);
		styleArr[0] = "font-size:16px;color:#cd55ff;";
		styleArr[1] = "font-size:12px;color:#ff6484;";
		styleArr[2] = "font-size:14px;color:#658491;";
		styleArr[3] = "font-size:15px;color:#aabbcc;";
		styleArr[4] = "font-size:14px;color:#946265;";
		styleArr[5] = "font-size:12px;color:#ff0000;";
		styleArr[6] = "font-size:16px;color:#69ad2d;";
		styleArr[7] = "font-size:12px;color:#000fff;";
		styleArr[8] = "font-size:14px;color:#002aff;";
		styleArr[9] = "font-size:16px;color:#ad3a3a;";
		var tagStyleArr = new Array();
		var index;
		var flag;
		for(var i=0; i<tagSize; i++){
			flag = false;
			index = Math.floor(Math.random()*styleArr.length);
			for(var j=0; j<tagStyleArr.length; j++){
				//判断如果此样式已经有了就break---防止重复
				if(tagStyleArr[j]==styleArr[index]){
					flag = true;
					break;
				}
			}
			if(flag){
				i--;
				continue;
			}
			tagStyleArr[i] = styleArr[index];
		}
		var divLength = 205;	//层的宽度	
		var temp = 0;			//中间量
		var padding = 7;		//标签之间的间距
		$(".random_style_tag").each(function(i){
			$(this).attr("style",tagStyleArr[i]);
		});
	});
	
	
</script>
<div class="h_mf">
	<h2>
		<span><a href="javascript:void(0);" onclick="setHash('#friend');">更多</a> </span><a>我家的邻居</a>
	</h2>
	<div class="h_mf_img">
		<c:choose>
			<c:when test="${fn:length(friendList) < 1}">
				<div style="font-size: 12px;margin-top: 10px;float: left;padding-left:10px;">目前还没有邻居</div>
				<a style="font-size: 12px;margin-top: 10px;float: right;cursor: pointer;text-decoration:underline;color:#005eac;padding-right:10px;" onclick="setHash('#searchFriendFamily');">查找邻居</a>
			</c:when>
			<c:otherwise>
				<ul>
					<c:forEach items="${friendList}" var="friend"> 
						<li>
							<a  href="#" onclick="seeOtherFamily('${friend.doorplate}')" class="h_mfImg_pp" onmouseover="familyTipShow(this,'${friend.doorplate}');" onmouseout="familyTipHide(this);"> 
								<img src="${friend.avatar}" width="58" height="58" alt="我的邻居" /> 
							</a>
							<a href="#" onclick="seeOtherFamily('${friend.doorplate}')">
								<c:out value="${friend.nickname}" /> 
							</a>
						</li>
					</c:forEach>
				</ul>
			</c:otherwise>
		</c:choose>
		
	</div>
</div>
<div class="clear"></div>
<div class="h_calendar">
          <div class="h_calendar_topBOX">
          	<div class="h_calendar_time">
              	<div class="h_calendar_features">
                  	<div class="h_calendar_date"><a href="javascript:void(0);" onclick="setHash('#calendar')"><img alt="日期" src="../images/home_images/ico36.png"></a></div>
                      <div class="h_calendar_set"><a href="#"><img alt="设置" src="../images/home_images/ico37.png"></a></div>
                  </div>
                  ${todayFormat} </div>
              <div class="h_calendar_top">
                  <ul>
                  	  <li id="calendar1" onclick="setHash('#calendar')" class="h_newNewsHover"><a href="javascript:void(0);">全部<span>${mainEventCount}</span></a></li>	
                  	  <li id="calendar2" onclick="setHash('#calendar')"><a href="javascript:void(0);">事件</a></li>
                  </ul>
              </div>
              <div class="clear"></div>
          </div>
          <div class="h_calendar_textBox">
		<div style="display:block;" id="con_calendar_1" class="h_calendar_text">
              	<div class="h_calendar_city">
				<span class="h_calendar_city_time">今天</span>    
                  </div>
                  <ul class="h_calendar_weather">
                      <li>
                      	<a href="javascript:void(0);" onclick="setHash('#calendar')">
                      	<c:choose>
                      		<c:when test="${lastEvent.mainContentCut==null || lastEvent.mainContentCut==''}">
                      			
                      		</c:when>
                      		<c:otherwise>
                      			${lastEvent.mainContentCut}
                      		</c:otherwise>
                      	</c:choose>
                      	</a>
                      </li>
                      <li>
					<a href="javascript:void(0);" class="h_calendar_weather_a" onclick="setHash('#calendar')">
					<c:choose>
                   		<c:when test="${futureEvent==null}">
                   			
                   		</c:when>
                   		<c:otherwise>
                   			(<fmt:parseDate var="dateObj" value="${futureEvent.startTime}" type="DATE" pattern="yyyy-MM-dd HH:mm:ss"/><fmt:formatDate value='${dateObj}' pattern='MM月dd日' />)${futureEvent.mainContentCut}
                   		</c:otherwise>
                   	</c:choose>
					
						</a>
                      </li>
                      <div class="clear"></div>
                  </ul> 
              </div>
          </div>
    </div>
<div class="h_came">
	<h2>
		<a>来串门的街坊</a>
	</h2>
	<div class="h_came_img">
		<c:choose>
			<c:when test="${fn:length(visitorList) < 1}">
				<div style="font-size: 12px;margin-top: 10px;float: left;">目前还没有街坊来串门</div>
			</c:when>
			<c:otherwise>
				<ul>
					<c:forEach items="${visitorList}" var="visitor">
						<li>
							<div class="newsList_img2 mr5 fn" onclick="seeOtherFamily('${visitor.family}')" 
								style="cursor: pointer;">
								<div class="own_img"  onmouseover="familyTipShow(this,'${visitor.family}');" onmouseout="familyTipHide(this);">
									<img src="${visitor.avatar}" alt="我的邻居" width="58" height="58" />
								</div>
								<div class="others_img">
									<img
										<c:choose>
															<c:when test="${visitor.familyAvatar!=null && visitor.familyAvatar!=''}">
																src="${visitor.familyAvatar}"
															</c:when> 
															<c:otherwise>
																src="images/avatar/family.jpg"
															</c:otherwise>
														</c:choose>
										width="24" height="24" alt="果果街" />
								</div>
							</div>
							<a href="#"
								onclick="seeOtherFamily('${visitor.family}')"><c:out
									value="${visitor.visitUsername}" /> </a><span><fmt:formatDate
									value="${visitor.gmtModified}" pattern="MM月dd日" /> </span>
						</li>
					</c:forEach>
				</ul>
			</c:otherwise>
		</c:choose>
		
	</div>
</div>
<div class="clear"></div>
<div class="h_may">
	<h2>
		<span><a href="javascript:void(0);" onclick="maybeFriends();">更多</a></span><a>可能认识的街坊</a></span>
	</h2>
	<div class="h_may_img">
		<ul>
			<c:forEach items="${maybeFriends}" var="friendFamily">
				<li>
					<div class="newsList_img2 mr10">
						<div class="own_img">
							<a href="#" onmouseover="familyTipShow(this,'${friendFamily.doorplate}');" onmouseout="familyTipHide(this);" onclick="seeOtherFamily('${friendFamily.doorplate}')"><img width="58" height="58" src="${friendFamily.avatar}"  alt="我的邻居" /></a>
							
						</div>
					</div>
					<em>
					<!-- 
					<a href="javascript:void(0);">加为邻居</a>
					 -->
					 <c:out value="${friendFamily.nickname}" /></em>
					<c:if test="${fn:length(friendFamily.fatherList) >0}">
						<p>
							爸 爸：
							<c:forEach items="${friendFamily.fatherList}" var="father">
									${father.friendName} 
							</c:forEach>
						</p>
					</c:if>
					<c:if test="${fn:length(friendFamily.motherList) >0}">
						<p>

							妈 妈：
							<c:forEach items="${friendFamily.motherList}" var="mother">
									${mother.friendName} 
							</c:forEach>
						</p>
					</c:if>
					
				</li>
				<div class="clear"></div>
			</c:forEach>
			
		</ul>
	</div>
</div>
<div class="h_tags">
        <h2><a href="javascript:void(0);">(${sessionScope.member.familyObj.nickname })的标签</a></h2>
        <div class="h_tags_text" id="tag_count" style="width: 205px;">
        	<c:if test="${familyTagList!=null && familyTagList!='[]' && fn:length(familyTagList)>0 }">
        		<c:forEach items="${familyTagList }" var="familyTag" varStatus="v" >
					<a style="font-size:16px;color:#69ad2d;" class="random_style_tag" href="javascript:void(0);" onclick="javascript:setHash(encodeURI('#toSearchFriendByTag,${familyTag.tagName }'));">${familyTag.tagName }</a>
        		</c:forEach>
        		<br />
        	</c:if>
            <c:if test="${familyTagList==null || familyTagList=='[]' || fn:length(familyTagList)<1 }">
            	标签是职业、兴趣爱好等方面的词语，添加后找到同类，也让同类找到你。
            </c:if>
            <span><a href="javascript:void(0);" onclick="setHash('#toAddTag')">添加标签</a></span>
        <div class="clear"></div>
        </div>
      </div>
<!--  
<div class="h_sns">
	<h2>
		<span><a href="#">更多</a> </span><a href="#">社区推荐</a>
	</h2>
	<div class="h_sns_text">
		<ul>
			<li>
				<img src="images/home_images/ico02.png" alt="出生" />
				<a href="#">圈出生活点滴，圈出美好回忆</a>
			</li>
			<li>
				<img src="images/home_images/ico23.png" alt="出生" />
				<a href="#">圈出生活点滴，圈出美好回忆</a>
			</li>
			<li>
				<img src="images/home_images/ico24.png" alt="出生" />
				<a href="#">圈出生活点滴，圈出美好回忆</a>
			</li>
			<li>
				<img src="images/home_images/ico25.png" alt="出生" />
				<a href="#">圈出生活点滴，圈出美好回忆</a>
			</li>
		</ul>
	</div>
</div>
<div class="h_tags">
	<h2>
		<a href="#">小仙宝典标签</a>
	</h2>
	<div class="h_tags_text">
		<a style="font-size: 16px; color: #69ad2d;" href="#">音乐</a>
		<a style="font-size: 12px; color: #000;" href="#">游戏</a>
		<a style="font-size: 14px; color: #002aff;" href="#">WOW</a>
		<a style="font-size: 12px; color: #ad3a3a;" href="#">篮球</a>
		<a style="font-size: 14px; color: #000;" href="#">画画</a>
		<a style="font-size: 12px; color: #ff0000;" href="#">打架</a>
		<a style="font-size: 16px; color: #69ad2d;" href="#">音乐</a>
		<a style="font-size: 12px; color: #000;" href="#">游戏</a>
		<a style="font-size: 14px; color: #002aff;" href="#">WOW</a>
		<a style="font-size: 12px; color: #ad3a3a;" href="#">篮球</a>
		<a style="font-size: 14px; color: #000;" href="#">画画</a>
		<a style="font-size: 12px; color: #ff0000;" href="#">打架</a>
		<a style="font-size: 16px; color: #69ad2d;" href="#">音乐</a>
		<a style="font-size: 12px; color: #000;" href="#">游戏</a>
		<a style="font-size: 14px; color: #002aff;" href="#">WOW</a>
		<a style="font-size: 12px; color: #ad3a3a;" href="#">篮球</a>
		<a style="font-size: 14px; color: #000;" href="#">画画</a>
		<a style="font-size: 12px; color: #ff0000;" href="#">打架</a>
	</div>
</div>
<div class="h_newTOP">
	<h2>
		<span><a href="#">更多</a> </span><a href="#">热门话题</a>
	</h2>
	<div class="h_newTOP_text">
		<ul>
			<li>
				<a href="#">抚州爆炸(254914)</a>
			</li>
			<li>
				<a href="#">长江中下游旱情持续(228296)</a>
			</li>
			<li>
				<a href="#">小牛晋级总决赛(2637067)</a>
			</li>
			<li>
				<a href="#">分享你的高考故事(3001827)</a>
			</li>
			<li>
				<a href="#">彭帅法网晋级32强(1907</a>5)
			</li>
			<li>
				<a href="#">抚州爆炸(254914</a>)
			</li>
			<li>
				<a href="#">长江中下游旱情持续(228296)</a>
			</li>
			<li>
				<a href="#">小牛晋级总决赛(2637067)</a>
			</li>
			<li>
				<a href="#">分享你的高考故事(3001827)</a>
			</li>
			<li>
				<a href="#">彭帅法网晋级32强(19075)</a>
			</li>
		</ul>
	</div>
</div>
-->

